﻿@model EF.Models.Customer
@{
    ViewBag.Title = "Index";
}

<h2>Customer Management</h2>

@using (Html.BeginForm())
{
    <div>User Name:</div>
    @Html.TextBoxFor(c => c.Id)
    
    <div>Password:</div>
    @Html.TextBoxFor(c => c.Password)
    
    <div>Full Name:</div>
    @Html.TextBoxFor(c => c.Fullname)
    
    <div>Email:</div>
    @Html.TextBoxFor(c => c.Email)
    
    <div>Photo:</div>
    @Html.TextBoxFor(c => c.Photo)
    
    <div>Activated:</div>
    <label>@Html.RadioButtonFor(c => c.Activated, true)Male</label>
    <label>@Html.RadioButtonFor(c => c.Activated, false)Female</label>
    
    <hr />
    <button onclick="form.action='/Customer/Insert'">Insert</button>
    <button onclick="form.action='/Customer/Update'">Update</button>
    <button onclick="form.action='/Customer/Delete'">Delete</button>
    <button onclick="form.action='/Customer/Index'">Reset</button>
}

<hr />

<table class="table">
    <tr>
        <th>User Name</th>
        <th>Password</th>
        <th>Full Name</th>
        <th>Email</th>
        <th>Photo</th>
        <th>Activated</th>
        <th></th>
    </tr>
    @foreach (var c in ViewBag.Customers)
    {
        <tr>
            <td>@c.Id</td>
            <td>@c.Password</td>
            <td>@c.Fullname</td>
            <td>@c.Email</td>
            <td>@c.Photo</td>
            <td>@c.Activated</td>
            <td>
                <a href="/Customer/Edit/@c.Id">Edit</a>
            </td>
        </tr>
    }
</table>
